﻿using System.Data;

namespace TurtleEngine
{
	 /// <summary>
	 ///
	 /// </summary>
	 public static class DatabasesHelper
	 {
		  /// <summary>
		  /// The databases
		  /// </summary>
		  private static DataTable databases = new DataTable("Databases");

		  /// <summary>
		  /// Gets the databases.
		  /// </summary>
		  /// <value>
		  /// The databases.
		  /// </value>
		  public static DataTable Databases
		  {
				get { return databases; }
		  }

		  /// <summary>
		  /// Gets the databases.
		  /// </summary>
		  public static void GetDatabases()
		  {
				databases.Clear();
				databases = Utility.DBConnection.GetSchema("Databases");

				string xmlfile = databases.TableName + ".xml";
				string xslFile = databases.TableName + ".xsl";
				string htmFile = databases.TableName + ".htm";

				//Utility.PrintDatatable(databases);
				Utility.WriteXML(databases, databases.TableName + ".xml");
				Utility.WriteHTML(xmlfile, xslFile, htmFile);
		  }
	 }
}